package com.pos.clothes.service.serviceImpl;


import com.pos.clothes.mapper.DiscountMapper;
import com.pos.clothes.pojo.Discount;
import com.pos.clothes.service.Strategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class discountStrategy implements Strategy {
    @Autowired
    private DiscountMapper mapper;

    @Override
    public float discount(float qian) {
        Discount discount =mapper.getAllDiscount();
        return qian*discount.getAll_rule();
    }
}
